<%@page import="com.kamilparzych.pl.manageMyCost.logic.CostEntryTool"%>
<%@page import="java.util.List"%>
<%@page import="javax.jdo.PersistenceManager"%>
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ page import="java.lang.StringBuilder"%>
<%@ page import="com.kamilparzych.pl.manageMyCost.data.PMF"%>
<%@ page import="com.kamilparzych.pl.manageMyCost.data.CostEntry"%>

<html>
<body>
<%
	PersistenceManager pm = PMF.get().getPersistenceManager();
	String query = "select from " + CostEntry.class.getName();
	List<CostEntry> costEntries = (List<CostEntry>) pm.newQuery(query)
			.execute();
	CostEntryTool cet = new CostEntryTool(costEntries);
%>
<div name="header">Total costs</div>
<div name="chart" align="center">Chart <br />
<img src="<%=cet.evaluateSimpleURI()%>"></img></div>
<br />
<br />
<table border="0">
	<tr>
		<td>
		<div name="csv" align="left"><%=cet.toCsv()%></div>
		</td>
		<td>
		<div name="htmltable" align="right"><%=cet.toHTMLTable()%></div>
		</td>
	</tr>
</table>
<div align="center"><a href="/request.html">Dodaj koszt</a></div>
</body>
</html>
